package com.luo.ai.assistant.config;

import com.luo.ai.assistant.chat.tool.function.CurrentDateTime;
import com.luo.ai.assistant.chat.tool.function.SetAlarm;
import com.luo.ai.assistant.chat.tool.function.SetAlarmRequest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Description;

import java.util.function.Consumer;
import java.util.function.Supplier;

/**
 * Spring AI工具函数配置
 *
 * @author luohq
 * @date 2025-02-07 16:08
 */
@Configuration
public class AiToolFunctionConfig {

    @Bean(CurrentDateTime.TOOL_NAME)
    @Description("Get the current date and time in the user's timezone")
    Supplier<String> currentWeather() {
		return new CurrentDateTime();
    }

    @Bean(SetAlarm.TOOL_NAME)
    @Description("Set a user alarm for the given time")
    Consumer<SetAlarmRequest> setAlarm() {
        return new SetAlarm();
    }
}
